<?php
class Mmod_phongkham extends CI_Model{
    function  __construct(){
        parent::__construct();
    }
    function insert_data($data){
	   $query = $this->db->insert('binhluan',$data);
       if($query)
        return True;
       else
        return False;
	}
    function getpk($aliaspk){
	   $this->db->where('alias',$aliaspk);
       $this->db->select(array('id','title','hits'));
       $query = $this->db->get('phongkham');

       if($query->num_rows() > 0){
            $data = $query->result();
            $query->free_result();
            return $data;
        }else return false;
	}
    function updatehits($id,$hits){
        $this->db->where('id', $id);
        $this->db->update('phongkham', array('hits'=>$hits)); 
        return false;
	}
}